﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VK.Comm;
using VK.Casemeet.Members;

namespace VK.Casemeet.Web.Front
{
    public partial class ActiveEmail : System.Web.UI.Page
    {
        public string strMessage = string.Empty;

        protected void Page_Load(object sender, EventArgs e)
        {
            MemberEntity member = MemberBLL.GetSessionMember();

            if (member.State == 1)
            {
                string content = member.Nickname + ",您好：\n\n " +
                        "感谢您注册中国户外探险联盟，你的中国户外探险联盟帐号是：" + member.Email + "\n\n " +
                        "请点击下面的链接来激活账号：\n " +
                        Util.GetHostUrl(Request.Url.Host, Request.Url.Port) + "/ActiveEmailComplete/" + member.ValidateCode + ".html\n " +
                        "(如果链接无法点击，请将它拷贝到浏览器的地址栏中。)\n\n " +
                        "中国户外探险联盟\n " +
                        DateTime.Now.ToLongDateString() + "\n\n " +
                        "此电邮为系统自动发出，请勿回复。\n ";
                if (MailHandle.ResetPassSend(member.Email, "中国户外探险联盟", "您在中国户外探险联盟的帐号激活验证邮件", content))
                {
                    strMessage = "确认信已成功发送到您的邮箱：" + member.Email;
                }
                else
                {
                    strMessage = "邮件发送失败！";
                }
            }
            else
            {
                Response.Redirect("/");
            }
        }
    }
}